package top.llove;

import org.eclipse.jgit.api.errors.GitAPIException;
import top.llove.utils.ApiDocs;

import java.io.IOException;

/**
 * ceshi
 *
 * @author: 幸会
 * @date: 2021/6/8 17:51
 * @email: 1846724873@qq.com
 * @description: ceshi
 * version: 1.0
 */
public class Test {
    public static void main(String[] args) throws GitAPIException, IOException {
//        Git clone = GitUtils.clone("https://github.com/ymhdev/res.git", "e:/c", GitUtils.getCredential("1846724873@qq.com", "ymh0217.."));
//        File directory = clone.getRepository().getDirectory();
//        System.out.println(directory.getAbsolutePath());
//        clone.close();

//        Git git = GitUtils.cloneGit();
//        git.close()

//        try(Git git = Git.open(new File("E:/img/")))  {
//            Repository repository = git.getRepository();
//            FetchResult call = git.fetch().call();
//            System.out.println(repository.getDirectory().getAbsolutePath());
//
//        } catch (IOException e) {
//            e.printStackTrace();
//        }

//        Git git = GitUtils.cloneGit();
//        Repository repository = GitUtils.getRepositoryFromDir("E:/img");
//        Git git = new Git(repository);
//        GitUtils.push(git, "哈哈哈");
//        git.pull().setRemoteBranchName(repository.getBranch())
//                .setCredentialsProvider(GitUtils.getCredential("1846724873@qq.com", "ymh0217")).call();

//        GitUtils.open().pull()
//                .setRemote("origin")
//                .setCredentialsProvider(GitUtils.getCredential("1846724873@qq.com", "ymh0217")).call();

//        String time = BaseUtils.getTime(-1);
//        System.out.println(time);

//        for (int i = 0; i < 100; i++) {
//            long before = System.currentTimeMillis();
//            System.out.println(IdUtil.fastSimpleUUID());
//            long after = System.currentTimeMillis();
//            System.out.println("第" + i + "耗费：" + (after - before));
//        }

//        GitUtils.pull();幸会
        ApiDocs.generate("", "", "");
    }
}
